﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TMV.Models;
using TMV.Repositories;
using TMV.UnitOfWork;

namespace TMV.Services
{
    public interface IAccountService : IApplicationService<ApplicationUser>
    {
        ApplicationUser GetByEmail(string email);
    }

    public class AccountService : ApplicationService<ApplicationUser>, IAccountService
    {
        IUnitOfWork unitOfWork;
        IAccountRepository accountRepository;

        public AccountService(IUnitOfWork unitOfWork, IAccountRepository accountRepository)
            : base(unitOfWork, accountRepository)
        {
            this.unitOfWork = unitOfWork;
            this.accountRepository = accountRepository;
        }

        public ApplicationUser GetByEmail(string email)
        {
            //return accountRepository.Get(u => u.Email.ToUpper() == email.ToUpper()).FirstOrDefault();
            return null;
        }
    }
}